# coding: utf-8
import socket,time

s = socket.socket()
host = "127.0.0.1"
port  = 6378

s.connect((host, port))

send_data = "set name hhq"
s.send(send_data.encode(encoding="ASCII"))
recvData = s.recv(1024).decode(encoding="ASCII")
print("has recv", recvData)
 

send_data = "get name ?"
s.send(send_data.encode(encoding="ASCII"))
recvData = s.recv(1024).decode(encoding="ASCII")
print("has recv", recvData)
 

send_data = "get name ?"
s.send(send_data.encode(encoding="ASCII"))
recvData = s.recv(1024).decode(encoding="ASCII")
print("has recv", recvData)

s.close()
